home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Diamond Collection
/
The Diamond Collection (Software Vault)(Digital Impact).ISO
/
cdr47
/
shwtxt16.zip
/
DPTHCHG.ST
< prev
next >
Wrap
Text File
|
1995-03-07
|
2KB
|
48 lines
'DPTHCHG.ST - Depth Charge Game
on intkey0 esc goto quit
'v0 = ship timer ────┐
'v1 to v5 = sub timer ├─timer value and speed are inversely proportional
'v6 to v10 = charge timer ──┘
'v11 = ship column
'v12 to v16 = sub column {row is determined by: ((sub#)*2)+14 }
'v17 to v21 = charge row
'v22 to v26 = charge column
'v27 to v31 = charge maximum depth (currently always set to 24)
cls\nochk\copy(dpthchg1,1)\copy(dpthchg2,2)
:start copy(1,0)\bfill0(7,16,7,20)ascii32\%h=0\%m=0\%c=20\rst ts
v0=16\v11=81\for %i=1 to 5\v%i=[rnd1to10]\v(%i+11)=[rnd1to16]\next
for %i=6 to 10\v%i=12\v(%i+11)=0\v(%i+16)=0\v(%i+21)=24\next
:chkin\waitkey 0\if key r then gosub rules\rst ts\goto chkin
if key q quit\if %c>0 chkin1
for %i=17 to 21\if v%i>0 chktmr\next %i\window(11,30,15,51)100,[fb:15:2]
p@12,36\p-\!"GAME OVER"\p@14,33\!"PLAY AGAIN ? /"\p+
color 30,2\p@14,46\!"Y";\p@14,48\!"N";
:play\waitkey\if key y start\if key n quit\goto play
:chkin1\if key null chktmr\%shc=85-v11\for %i=22 to 26\if v%i=%shc chktmr\next
for %i=17 to 21\if v%i<>0 then gonext
v%i=4\v(%i+5)=%shc\poke0(v%i,v(%i+5))22 28
color 4,7\%c--\p@25,55\!%c,2zq;\goto chktmr\next
:chktmr\for %t=0 to 10\if [tm:v%t:%t:255] action\next\goto chkin
:action\rst t%t\select case %t
case 0\v11--\if v11=7 then v11=81
bcopy1to0(2,v11,2,v11+79)(3,1)
case 1 to 5\%tn=%t+11\v%tn++\if v%tn>100 then v%tn=[rnd1to16]\v%t=[rnd1to10]
%sr=(%t*2)+14\bcopy1to0(6,v%tn,6,v%tn+79)(%sr,1)
for %i=17 to 21\if v%i<>0 then poke0(v%i,v(%i+5))22 28
next\if not [ir:17:v%tn:96] subx\%sc=(97-v%tn)
for %i=17 to 21\if v%i<>%sr or v(%i+5)<>%sc then gonext
poke0(v%i,v(%i+5))15 28\gosub boom\bfill0(%sr,1,%sr,80)32 23
v%i=0\v(%i+5)=0\v(%i+10)=24\v%tn=[rnd1to16]\v%t=[rnd1to10]\goto subx\next\:subx
case 6 to 10\%tr=%t+11\if v%tr=0 chgx\%tc=%t+16\%tm=%t+21
poke0(v%tr,v%tc)32 23\if v%tr=v%tm then color 4,7\%m++\p@25,42\!%m,2zq\goto chgr
v%tr++\if [as:0:v%tr:v%tc]=32 then poke0(v%tr,v%tc)22 28\goto chgx
poke0(v%tr,v%tc)15 28\gosub boom\bfill0(v%tr,1,v%tr,80)32 23
%sn=(v%tr-14)/2\v%sn=[rnd1to10]\v(%sn+11)=[rnd1to16]
:chgr\v%tr=0\v%tc=0\v%tm=24\:chgx
end select\goto chkin
:boom\for %j=1 to 6\bxor0(1,1,25,80)255\wait.06\next
color4,7\%h++\p@25,30\!%h,2zq\ret
:rules\save\copy(2,0)59\waitkey\restore60\ret
:quit \ exitc